﻿using Domain.Entity;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EfCore.Configers
{
    public class EMRConfigers : IEntityTypeConfiguration<EMR>
    {
        public void Configure(EntityTypeBuilder<EMR> builder)
        {
            builder.ToTable(nameof(EMR));

            builder.HasKey(e => e.MreId);

            builder.Property(e => e.MreId).ValueGeneratedOnAdd();

            builder.Property(e => e.FirstKindName).HasMaxLength(50);
            builder.Property(e => e.SecondKindName).HasMaxLength(50);
            builder.Property(e => e.ThirdKindName).HasMaxLength(50);
            builder.Property(e => e.MajorName).HasMaxLength(50);
            builder.Property(e => e.EngageType).HasMaxLength(50);
            builder.Property(e => e.Register).HasMaxLength(50);
            builder.Property(e => e.Changer).HasMaxLength(50);
            builder.Property(e => e.MajorDescribe).HasMaxLength(500);
            builder.Property(e => e.EngageRequired).HasMaxLength(500);
        }
    }
}
